<include file="../Public/_header.html" />

<div class="so_main">
	<php>if($type!='edit'){</php>
  		<div class="page_tit">录入商户</div>
  <php>}else{</php>
  		<include file="../Admin/Tpl/default/Partner/top_box.html" />
  <php>}</php>
  <style>
  	.form2 dl{
  		float: left;
    	width: 50%;
    }
  </style>
  <div class="form2" id="main_area">
  	<form method="post" 
  		<php>if($type!='edit'){</php>
  				action="{:U('/Partner/doAddPartner')}" 
		  <php>}else{</php>
		  		action="{:U('/Partner/doEditPartner')}" 
		  <php>}</php>
  				enctype="multipart/form-data">
  	<input name="id" id='id' type="hidden" value="{$partner.id}">
  		<div class="clear"></div>
   	<dl class="lineD" style="font-weight:bold;height:30px;">
      <dt>基本信息：</dt>
				<dd>
				</dd>
    </dl>
    <dl class="lineD" style="height:30px;">
				<dt style="color:red;">是否生效：</dt>
				<dd style="margin-top: 0px;">
					<span>
						<input name="enable" type="checkbox" 
									<eq name="partner['enable']" value="Y">checked = "checked"</eq>
									value="Y">
						钩选为生效
					</span>
				</dd>
		</dl>
    
    <dl class="lineD">
      <dt>名称：</dt>
      <dd>
        <input name="title" type="text" value="{$partner.title}">
      </dd>
    </dl>
    
    
    <dl class="lineD">
      <dt>商标：</dt>
      <dd>
      	<input type="text"  value="图片编辑区设置商标图片！" readonly ><!-- input type="file"  name="brand_icon"/-->
      </dd>
    </dl>
    
    
    <dl class="lineD">
      <dt>分类：</dt>
      <dd>
      	<input id="sortdesc" type="text" value="{$partner['sort_id']|getCategoryName}" 
      					onclick="ui.box.load(
    											'{:U('Index://Public/showtree',array('code'=>'partner'))}'
    											,{ title:'查看商户分类' })"
      					readonly>
      	<input id="sort_id" name="sort_id" type="hidden" value="{$partner['sort_id']}">
			<script>
					function _tmp_setselectdict(rel,txt){
			    		$('#sortdesc').val(txt);
			    		$('#sort_id').val(rel);
			    }
			</script>
      </dd>
    </dl>
    
    <dl class="lineD">
      <dt>上级：</dt>
      <dd>
      	<input id="parentdesc" type="text" value="{:getParnterTitle($partner['parent_id'],'无上级商户')}"
					        onclick="	if($('#parentdesc').val()=='无上级商户')$('#parentdesc').val('');
					        					k_pop_syncSearch('parent_id'
					        													,'parentdesc'
					        													,'选择上级商户'
					        													,'{:U('Admin://Partner/getJson',array('level'=>1,'ignoreId'=>$partner['id']))}'
					        													,function(){ if( $('#parent_id').val()=='{$partner['id']}'){
					        																						$('#parentdesc').val('无上级商户');
					        																						$('#parent_id').val('');
					        																						k_alert('不能将商户本身设为上级商户','提示');
					        																					}else{
					        																						ui.box.close();
					        																					}
					        																		 }
					        													,function(){ $('#parentdesc').val('无上级商户');$('#parent_id').val(''); })" 
					        readonly >
				<input name="parent_id" id="parent_id" type="hidden" value="{$partner['parent_id']}">
      </dd>
    </dl>
    
	<dl class="lineD" style="width:100%;">
      <dt>简介：</dt>
      <dd>
      	<input type="text" name="brief" value="{$partner['brief']}" style="width:652px">最多６０字！
      </dd>
    </dl>
    <php>if($type!='edit'){</php>
    <dl class="lineD">
      <dt>管理员密码：</dt>
      <dd>
      	默认为111111
      </dd>
    </dl>
    <dl class="lineD">
      <dt>验证员密码：</dt>
      <dd>
      	默认不需要
      </dd>
    </dl>
    <php>}</php>
	<div class="clear"></div>
   	<dl class="lineD" style="width:100%;padding-top: 10px;font-weight:bold;">
      <dt>附加信息：</dt>
    </dl>
    
    <dl class="lineD">
      <dt>联系人：</dt>
      <dd>
        <input name="contact" type="text" value="{$partner.contact}">
      </dd>
    </dl>
    
    <dl class="lineD">
      <dt>电话：</dt>
      <dd>
        <input name="phone" type="text" value="{$partner.phone}">
      </dd>
    </dl>
    
    
    <dl class="lineD">
      <dt>手机：</dt>
      <dd>
        <input name="mobile" type="text" value="{$partner.mobile}">
      </dd>
    </dl>
    <dl class="lineD">
      <dt>网址：</dt>
      <dd>
        <input name="homepage" type="text" value="{$partner.homepage}">
      </dd>
    </dl>
    <dl class="lineD">
      <dt>地区：</dt>
      <dd>
        <input type="hidden" id="current" name='gparea'
					value="{:assembleAreaIds($partner['province_id'],$partner['city_id'],$partner['area_id'])}"/>
				<!--province city area-->
				<input type="text" name="city"  id="selectarea"
					value="{:getAreaDesc($partner['province_id'],$partner['city_id'],$partner['area_id'])}"
					class="text" onfocus="this.className='text2'" onblur="this.className='text'" readonly  
					onclick="ui.box.load('{:U('Index://Public/area',array('selected'=>''))}'+$('#current').val(),{title:'选择城市'});" />
      </dd>
    </dl>
    <dl class="lineD">
      <dt>地点：</dt>
      <dd>
     		<input name="tag" id="tag" type="text" value="{$partner.tag}" 
        							onclick="	var _tmp_gparea_ = k_parseArea($('#current').val(),'c');
        										k_pop_syncSearch('popular_id'
					        									,'tag'
					        									,'选择热门地点'
					        									,'{:U('Admin://AreaPopular/getJson',array('city_id'=>''))}'+_tmp_gparea_
					        									,function(){ 
					        													$('#tag').val($('#tag').val()+',');
					        													ui.box.close();
					        												
					        												}
					        									,function(){ $('#tag').val(''); } )" 
					     readonly>
			<input type="hidden" id="popular_id" name='popular_id' value=""/>
      </dd>
    </dl>
    <dl class="lineD">
      <dt>地址：</dt>
      <dd>
        <input name="address" type="text" value="{$partner.address}">
      </dd>
    </dl>
    
    <dl class="lineD">
      <dt>邮编：</dt>
      <dd>
        <input name="zipcode" type="text" value="{$partner.zipcode}">
      </dd>
    </dl>
    
    <dl class="lineD">
      <dt>坐标：</dt>
      <dd>
        <input name="location" type="text" value="{$partner.location}">
      </dd>
    </dl>
   	<div class="clear"></div>
   	<dl class="lineD" style="width:100%;padding-top: 10px;font-weight:bold;">
      <dt>帐户设置：</dt>
    </dl>
    <dl class="lineD" style="width:100%">
      <dt>开户银行：</dt>
      <dd>
        <input name="bank_name" type="text" value="{$partner.bank_name}" style="width:300px">
      </dd>
    </dl>
    <dl class="lineD" style="width:100%">
      <dt>银行账号：</dt>
      <dd>
        <input name="bank_no" type="text" value="{$partner.bank_no}" style="width:300px">
      </dd>
    </dl>
    <dl class="lineD" style="width:100%">
      <dt>开户名：</dt>
      <dd>
        <input name="bank_user" type="text" value="{$partner.bank_user}" style="width:300px">
      </dd>
    </dl>
    <div class="clear"></div>
    <div class="page_btm" style="padding: 18px 0 18px 0;text-align: center;">
      <input type="submit" class="btn_b" value="提交" />
    </div>
    </form>
  </div>

</div>
<include file="../Public/_footer.html" />